<template>
  <div class="page-head">
    <div class="head-base">
      <div class="header-box">
        <div class="header w-1400">
          <div class="left">
            <span class="wel-text">
              Hi，欢迎来到工程5188信息共享平台！
            </span>
          </div>

          <div class="right">
            <div>
              <router-link to="/supplierLogin">我是供应商</router-link>
            </div>
            <div>
              <router-link to="/businessPersonnelLogin">我是业务员</router-link>
            </div>
            <div>
              <router-link to="/vipCenter">服务中心</router-link>
            </div>

          </div>
        </div>
      </div>
    </div>

    <div class="head-search">
      <div class="header-box w-1400">
        <div class="header">
          <div class="left-logo">
            <img src="@/static/engineering5188/common/logo.png" @click="$router.push('/')" />
          </div>
          <div class="center-search">
            <div class="search-wrap">
              <div class="search-box">
                <el-input type="text" prefix-icon="el-icon-search" v-model="keyword" placeholder="请要输入要搜索的内容" />
                <button @click="searchData"> 搜索
                </button>
              </div>
            </div>
          </div>
          <div class="qrCode-box">
            <img src="@/static/engineering5188/common/qrCode.png" />
            <span class="qrCode-text">扫码关注 了解更多</span>
          </div>
        </div>
      </div>
    </div>

    <div class="head-nav">
      <topNavModel />
    </div>
  </div>
</template>

<script>
import topNavModel from "@/components/common/engineering5188/topNavModel.vue";



export default {
  name: "HeaderIndex",
  components: {
    topNavModel
  },
  data() {
    return {
      keyword: ''
    };
  },

  computed: {

  },

  watch: {

  },

  created() {

  },

  methods: {
    searchData(){
      this.$router.push({
        path: '/searchResult',
        query: {
          keyword: this.keyword
        }
      })
    }
  }
};
</script>

<style lang="less">
.w-nav-popover .popper__arrow {
  display: none !important;
}

.w-nav-popover {
  padding: 0 !important;
  margin-top: 2px !important;
  // border: none !important;
}

.pop-child {
  .child-item {
    text-align: center;
    display: block;
    height: 40px;
    line-height: 40px;

    background: #fff;
    font-size: 14px;
    font-family: Microsoft YaHei-Regular, Microsoft YaHei;
    font-weight: 400;
    color: #000000;

    &:hover {
      background: #4CA5E4;
      color: #fff;
    }
  }
}
</style>

<style scoped lang="less">
.head-base {
  .header-box {
    background: #F6F6F6;
  }

  .header {
    max-width: @engineerwidth;
    height: 36px;
    line-height: 36px;
    // padding: 0 10px;
    margin: 0 auto;
    color: #F6F6F6;
    font-size: 12px;

    .left {
      float: left;
      min-width: 20%;
      text-align: left;

      .wel-text {
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 14px;
        color: #333333;
        height: 36px;
        line-height: 36px;
        text-align: left;
        font-style: normal;
      }
    }

    .right {
      float: right;
      display: flex;
      justify-content: flex-end;
      width: 60%;
      padding: 0 0;
      color: #333;

      a {
        color: #333;
      }


      div {
        margin-right: 28px;
        cursor: pointer;
        font-family: MicrosoftYaHei, MicrosoftYaHei;
        font-weight: normal;
        font-size: 13px;
        color: #333333;
        height: 36px;
        line-height: 36px;
        text-align: left;
        font-style: normal;
        text-transform: none;

        &:last-child {
          margin-right: 0;
        }
      }
    }
  }
}

.head-search {

  .header-box {
    max-width: @engineerwidth;
    height: auto;
    padding: 20px 0;
  }

  .header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .left-logo {
      margin-left: 30px;
      cursor: pointer;
      justify-content: flex-start;

      img {
        height: 56px;
        cursor: pointer;
      }

      span {
        margin-left: 10px;
        font-size: 30px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 30px;
        color: #333333;
      }
    }

    .center-search {
      flex: 1;
      margin-left: 86px;
      display: flex;
      align-items: flex-start;

      .search-wrap {
        width: 100%;
      }
    }

    .qrCode-box {
      margin-left: 97px;
      margin-right: 93px;
      display: flex;
      flex-direction: column;
      align-items: center;

      img {
        height: 48px;
        width: 48px;
      }

      .qrCode-text {
        margin-top: 12px;
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 12px;
        color: #333333;
        text-align: left;
        font-style: normal;
      }
    }
  }

  .center-search {
    .search-box {
      border: 2px solid #31A41B;
      .flex();
      width: 100%;
      height: 40px;
      background: #ffffff;
      opacity: 1;
      background: #efefef;
      overflow: hidden;
      overflow: hidden;

      input {
        flex: 2;
        height: 100%;
        height: 48px;
        border: none;
        outline: none;
        background: #fff;
        padding-left: 30px;
        padding-right: 30px;
        // border: 2px solid #333;
        font-size: 14px;
        font-family: Microsoft YaHei;
        color: #000;

      }

      button {
        width: 104px;
        height: 48px;
        background: #31A41B;
        border: none;
        outline: none;
        cursor: pointer;

        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 16px;
        color: #FFFFFF;


      }

    }

    .search-suggest {
      margin-top: 10px;
      display: flex;
      align-items: center;
      font-size: 12px;

      b {
        color: #000;
        display: inline-block;
        min-width: 40px;
      }

      .suggest-list {
        display: flex;
        color: #9f9f9f;

        .item {
          margin-left: 10px;
          cursor: pointer;

          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          line-height: 26px;
          color: #9f9f9f;

          &:hover {
            color: #333;
            font-weight: bold;
          }
        }
      }
    }
  }
}


//
//
//
//
//






.page-head {
  position: sticky;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  line-height: 0;
  padding: 0;
  // border-bottom: 4px solid #009a44;
  // box-shadow: 0px 3px 10px 1px rgba(0, 0, 0, 0.16);
  background: #fff;
}

.header-inner {
  position: relative;
  width: 1200px;
  height: 150px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .logo-wrap {
    display: flex;
    align-items: center;

    .logo-box {
      cursor: pointer;

      img {
        width: 141px;
        height: 82px;
      }
    }
  }



  .nav-wrap {
    flex: 1;
    margin-left: 60px;
    margin-right: 92px;
  }

  .nav-list {
    height: 100%;

    .nav-item {
      // flex: 1;
      text-align: center;

      &.nav-item-static {
        position: static;
      }

      .nav-link {
        position: relative;
        display: inline-block;
        height: 50px;
        line-height: 50px;
        font-family: Poppins, Poppins;
        font-weight: 600;
        font-size: 17px;
        color: #333333;


        &::after {
          content: "";
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translate(-50%);
          width: 0;
          height: 2px;
          background: #4CA5E4;
          transition: 0.3s;
        }
      }

      &:hover {
        .nav-link::after {
          width: 36px;
        }
      }

      &.active {
        .nav-link {
          // font-weight: bold;
          color: #4CA5E4;

          &::after {
            // width: 36px;
          }
        }
      }

      a {
        color: #222;
        width: 100%;
        font-size: 16px;
        font-family: Microsoft YaHei-Regular, Microsoft YaHei;
        font-weight: 400;
        color: #333;
      }
    }
  }
}

.user-act {
  width: 440px;
  width: fit-content;
}


.center-search-wrap {
  position: relative;
  margin-right: 25px;

  &:hover {
    .search-suggest-list {
      display: block;
    }
  }

  .center-search {
    width: 270px;
    border-bottom: 1px solid #999999;

    .flex();
    align-items: stretch;

    border-radius: 5px;
    position: relative;
    overflow: hidden;


    .search-box {
      // border: 1px solid #aaa;
      .flex();
      overflow: hidden;
      // height: 100%;

      input {
        display: block;
        width: 317px;
        height: 38px;
        padding-left: 10px;

        &::-webkit-input-placeholder {
          font-weight: normal;
          font-size: 14px;
          color: #909090;
        }
      }

      .btn-search {
        .flex-center();
        position: absolute;
        right: 0;
        width: 40px;
        height: 40px;
        background: #4CA5E4;
        border-radius: 0px 6px 6px 0px;
        font-weight: normal;
        font-size: 16px;
        color: #FFFFFF;
        background: transparent;

        &:hover {
          opacity: 1 !important;
        }

        .img-search {
          width: 20px;
          height: 20px;
          cursor: pointer;
          transition: 0.3s;
          margin-right: 11px;

          &:hover {
            opacity: 0.85;
          }
        }
      }


    }
  }

  .search-suggest-list {
    display: none;
    position: absolute;
    z-index: 100;
    left: 0;
    right: 0;
    top: 43px;
    border: 1px solid #ddd;
    border-top: none;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;

    .search-suggest-item {
      .ellipsis-1();
      line-height: 3.5rem;
      height: 3.5rem;
      padding: 0 5px;
      text-align: left;
      transition: 0.3s;

      &:hover {
        background: #f5f5f5;
      }

      a {
        .ellipsis-1();
        display: block;
        width: 100%;
        height: 100%;
        color: #888;
        font-size: 1.3rem;

        &:hover {
          color: #4CA5E4;
        }
      }
    }
  }

}


.info-right {
  .flex();


  .log-box {
    .flex();
  }


  a {
    color: #fff;
    .flex();

    img {
      width: 30px;
      height: 30px;
    }
  }

  .user-login {
    width: 30px;
    height: 30px;
  }

  .user-reg {
    margin: 0 16px;
    width: 30px;
    height: 30px;
  }

  .qrCode-image {
    width: 30px;
    height: 30px;
  }

  .shopcart {
    position: relative;
    width: 30px;
    height: 30px;
    .flex-center();

    img {
      width: 30px;
      height: 30px;
    }

    .qrCode-num {
      .flex-center();
      position: absolute;
      right: -10px;
      top: -10px;
      min-width: 18px;
      min-height: 18px;
      padding: 0 3px;
      background: #FF3B30;
      border: 1px solid #FFFFFF;
      border-radius: 50%;
      font-size: 12px;
    }
  }
}



.user-login-info {
  position: absolute;
  right: 0;
  top: 12px;


  .avatar-box {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .phone {
    margin: 0 16px;
    font-family: Arial, Arial;
    font-weight: 400;
    font-size: 16px;
    color: #999999;

    &:hover {
      color: #4CA5E4;
    }
  }

  .logout {
    font-family: Arial, Arial;
    font-weight: 400;
    font-size: 16px;
    color: #999999;

    &:hover {
      color: #4CA5E4;
    }
  }
}




@media screen and (max-width: 1600px) {
  .header-inner .nav-list .nav-item {
    margin-left: 10px;
    min-width: 80px;
  }

  .left-select {
    width: 160px !important;
  }
}

@media screen and (max-width: 1520px) {
  .header-inner .nav-list .nav-item {
    margin-left: 10px;
    min-width: 80px;
  }

  .left-select {
    width: 150px !important;
  }
}
</style>

<style scoped lang="less" src="@/assets/h5css/zujian/pageHeader.less"></style>
